package com.github.cloud.feign;

import com.github.cloud.feign.fallback.UserServiceFallbackImpl;
import com.github.cloud.model.vo.UserVo;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * Created by guxiaowei on 2018/3/7.
 * 远程调用方法
 */
@FeignClient(name = "cloud-admin",fallback = UserServiceFallbackImpl.class)
public interface UserService {

    /**
     * 通过用户名查询用户及其角色信息
     *
     * @param username 用户名
     * @return UseVo 对象
     */
    @GetMapping("/user/findUserByUsername/{username}")
    UserVo findUserByUsername(@PathVariable("username") String username);
}
